Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
…value A SelectableCard with a `value` in place of `isSelected` and `onChange` is a member of the SelectableCardGroup around it. The group gives the card its selection, its input (a radio in a single choice, a checkbox in several), its input name and its disabled default, and the card sends the group its selection requests. Membership stops at a layer boundary. The new SelectableCardMemberProps type describes a member. SelectableCardProps stays an interface and gains only `value?: never`, so TypeScript rejects `isSelected` or `onChange` beside `value`. Outside a group, a card with a `value` warns in development and stays unselected. Lab's SelectableCardGroup takes these cards as its children, so SelectableCardGroupItem and SelectableCardGroupItemProps are removed. The `component:SelectableCard` record admits `value` (DEC-1).
a60f64c to
9e86180
Compare
|
Rebased onto main at a92c1ce; the new head is 9e86180. Conflicts came up only in the SelectableCard record and On this head, |
|
/approve-spec 9e86180 |
docs/specs/components/SelectableCard/SelectableCard.spec.md: the verification map keeps main's rows and this branch's group-membership row. No other change.
|
/approve-spec c903d9b |
There was a problem hiding this comment.
Changes requested. The amended SelectableCard record is approved at this head; these code and description issues still need to change:
- The card's props type stops being extendable in a patch release: changing
SelectableCard's parameter toSelectableCardProps | SelectableCardMemberPropsmakesinterface X extends ComponentProps<typeof SelectableCard>fail (TS2312) and stopsOmit<ComponentProps<typeof SelectableCard>, …>from spreading back onto the card (TS2322), a type break thatspec:AST-017FR25 rules out in a patch and that makes "A standalone card does not change" (Changeset), "keeps its props" (description) and "additive" (record) untrue, so declare two overloads, the member signature first and the standalone one last, which compile locally and still reject both and neither. - New internal shared module that no record names:
selectableCardGroupContext.ts, re-exported through Core'sinternal/selectable-cardentry for Lab, needsSelectableCardGroupContextand its membership shape named in the SelectableCard record with whySelectableCardInputContextwas not enough (architecture:knowledge-contractsDEC-22), and that record edit then needs a fresh/approve-spec. - Stable Core output names a Lab-only component: the development warning, the exported JSDoc,
SelectableCard.doc.mjsand the Core Changeset point consumers atSelectableCardGroup, whichspec:AST-017FR27 forbids while the group is in Lab, so merge this together with the group's move to Core or keep those mentions out of Core until then. - Every SelectableCard page pays 329 bytes gzip for an opt-in feature: measured locally with the boundary check's own measurement, a page that renders
SelectableCardwithoutvalueloads 18,339 instead of 18,010 bytes of gzip JavaScript, over the 0.3 KBarchitecture:component-import-boundariesINV10 allows, and dropping theuseDevWarningcall brings the growth to 109 bytes. - A card with a stray
valueis not inert: the description and the approved Group value row say such a card "renders unselected and inert", but it keeps its hover and press paint, runs the caller'sonClickand stays an enabled checkbox, so treat a card with avalueand no group as disabled and assert that in its test. - The description misstates what #13734 does: that pull request keeps Core's
internal/selectable-cardentry and removes only the context exports andjoinAriaIDs, so reword "#13734 removes the entry when the group moves to Core."
The member behaviour itself checks out locally: the three test files pass, the type guards reject both and neither, and membership stops at a layer.
Claims and files checked
Review mode: full; reason: recipe-changed (many rules)
Claims:
- Title: a card joins its group by value: verified (
SelectableCard.tsx:518-547; member tests inSelectableCardRadio.test.tsx, run locally) - Changeset: a card with a value is a member of the group around it, which gives it its selection, input and disabled default: verified (
SelectableCard.tsx:520-536; radio, checkbox and disabled member tests, run locally) - Changeset: in a single choice the card is a native radio that selects and never deselects itself: verified (
SelectableCard.tsx:536,:544-545; the "never deselects itself" test) - Changeset: in a multiple choice the card is a checkbox that submits its value under the group's name: verified (
SelectableCard.tsx:673-674; Lab group sets the input name to the submit name; checkbox member test) - Changeset: a new props type describes a member: verified (
SelectableCard.tsx:404-418;SelectableCard/index.ts) - Changeset and description: the existing props type stays an interface and gains only an optional never-typed value, so extending it and omitting from it keep working: verified (built API surface of both trees; the props-type test, compiled locally)
- Changeset and description: TypeScript rejects isSelected or onChange beside value, and a card with neither: verified (compiled locally; the test's expect-error lines pass CI typecheck)
- Changeset: outside a group, a card with a value warns in development and stays unselected: verified (
SelectableCard.tsx:522-530; test atSelectableCardRadio.test.tsx:337) - Changeset: a standalone card does not change: false (derived props types break, TS2312 and TS2322, compiled locally)
- Description: today a single choice needs Lab's own item component, which repeats the card's props, and the card's record keeps single choice out of its contract: verified (base group source and base record)
- Description: the group gives a member its selection, input, input name and disabled default, the card sends selection requests, and a radio only selects: verified (
SelectableCard.tsx:520-547) - Description: the group's children are SelectableCards, the item component and its props type are removed, and one private context replaces the wrapper: verified (Lab index files; no remaining reference anywhere in the repository, searched)
- Description: the chosen, enabled radio card renders the hidden input that submits the group's value under its form name: verified (
SelectableCard.tsx:693-695; form-value test) - Description: membership stops at a layer, in a popover or a dialog, as the toggle-button group's context does: verified (layer test, run locally; every layer renders the same content boundary; the toggle-button group uses the same layer-scoped context)
- Description: the card's record admits the member case with a decision, a group value concept and the member contract: verified (record diff; approved at this head)
- Description: Lab reaches the context through Core's internal entry, which now exports the group context: verified (
internal/selectable-card.ts:18-19) - Description: the follow-up pull request removes that entry: false (its diff keeps the entry)
- Description: a card is typed as standalone or as a member, never both: verified (compiled locally)
- Description: under the compatibility rule the change is additive because the props type keeps its members and the member shape is a new type: false for the component's derived props type (compiled locally)
- Description: the public delta block shows the union parameter: matches the code (
SelectableCard.tsx:513), which is the compatibility finding - Description: a standalone card keeps its props, defaults, DOM and behaviour: false for its derived props type; defaults, DOM and behaviour verified (
SelectableCard.test.tsx, 21 tests, run locally) - Description: outside a group, a card with a value warns once in development and renders unselected and inert: warns once per card and unselected verified; inert false (
SelectableCard.tsx:621,:644,:654,:683; probed locally) - Description: a member's own disabled state adds to the group's, and a disabled member submits nothing: verified (
SelectableCard.tsx:533,:679,:693; disabled and form tests) - Description: in a group's DOM only the hidden submit input moves, with no theming target, data attribute, token or string change: verified by comparing both render paths (no new target, attribute, token or catalog string; the only new text is a console development warning)
- Description: the new type name is the owner decision, approved with the record: verified (approved at this head)
- Description: the rejected designs and why the card renders the hidden input: reasoning; the shipped union parameter has the same extension break the description gives for rejecting a union props type
- Description: this should not ship in a release without the follow-up pull request: reported intent; nothing enforces it (stable-output finding)
- Description: before and after screenshots, pixel-identical, with matching input attributes: reported (taken before the last rebase)
- Description: the listed unit cases: verified by reading and running the three test files locally (49 passed); mutation and Chromium results: reported (the Chromium spec runs in deferred CI)
- Description: local preflight and test runs: reported
- Description: the latest main merge only keeps main's verification rows and adds this branch's row: verified (per-file patch comparison with the previous head; only the nested-control row differs, as on main)
- Description: scope checklist (one capability, no unrelated changes, docs and tests ship, no internal context): verified (no tagalong; public text clean)
- Description: writing rubric results for the record: verified (present tense; one rejected alternative; the rewritten rows keep main's gap wording)
Files:
.changeset/selectable-card-group-value.md: finding (names the Lab-only group; "A standalone card does not change")apps/storybook/stories/SelectableCardGroup.stories.tsx: cleardocs/specs/components/SelectableCard/SelectableCard.spec.md: finding (the Owns bullet does not name the context; "inert" in the Group value row; "additive" compatibility rows)packages/cli/test/swizzle-proof/samples.mjs: clearpackages/core/src/SelectableCard/SelectableCard.doc.mjs: finding (names the Lab-only group)packages/core/src/SelectableCard/SelectableCard.tsx: finding (union parameter; Lab-only name in the warning and JSDoc; size; stray value stays interactive)packages/core/src/SelectableCard/SelectableCardRadio.test.tsx: finding (the "inert" test checks only selection)packages/core/src/SelectableCard/index.ts: clearpackages/core/src/SelectableCard/selectableCardGroupContext.ts: finding (no record names it)packages/core/src/SelectableCard/selectableCardInput.ts(deleted): clearpackages/core/src/internal/selectable-card.ts: finding (re-exports the unnamed module)packages/lab/blocks/SelectableCardGroupShippingSpeed.doc.mjs: clearpackages/lab/blocks/SelectableCardGroupShippingSpeed.tsx: clearpackages/lab/blocks/SelectableCardGroupShowcase.doc.mjs: clearpackages/lab/blocks/SelectableCardGroupShowcase.tsx: clearpackages/lab/src/SelectableCardGroup/SelectableCardGroup.doc.mjs: clearpackages/lab/src/SelectableCardGroup/SelectableCardGroup.test.tsx: clearpackages/lab/src/SelectableCardGroup/SelectableCardGroup.tsx: clearpackages/lab/src/SelectableCardGroup/index.ts: clearpackages/lab/src/index.ts: clear
…inert - Two call signatures, the member one first, keep `ComponentProps<typeof SelectableCard>` the standalone interface, so a wrapper that extends or omits from it compiles again. - A card with a `value` outside a group is disabled: no click, no hover or press paint, and its checkbox reads as disabled. - Drop the development warning. The inert card shows the mistake, and the warning was most of the card's added bundle size. - Core's JSDoc, doc and changeset say "card group" and name no Lab surface. - Keep the internal `selectableCardInput.ts` module and its `SelectableCardInputContext` name for the group's membership context, instead of a new module. - Add a story for a card with a value outside a group. Co-authored-by: Ernest Tien <ernesttien@meta.com>
|
/approve-spec d4f41c2 |
There was a problem hiding this comment.
Changes requested. The member API works as described, and the amended SelectableCard record is approved at this head. Three statements do not match what this head ships:
- The record promises a development warning the code no longer emits: the record's Group value row says a card with a
valueoutside a group "warns in development", but this head only disables it, so reword that sentence (for example "renders unselected and disabled (FR5)") and have an engineering owner re-approve the record. - The description's public delta still shows the union signature: the code block under "Public delta and caller burden" declares
SelectableCard(props: SelectableCardProps | SelectableCardMemberProps): ReactNode, so replace it with the two overloads this head ships. - Formatting churn contradicts the scope checklist:
SelectableCard.doc.mjsre-wraps entries this change does not touch (usage, anatomy,padding,variant,elevation,xstyle, theming), so restore main's layout for those entries or uncheck "Unrelated fixes, cleanup, and policy changes were removed or split".
Non-blocking:
- Bump the context's protocol version:
SelectableCardInputContextchanged its value's shape but keeps version 1, and version 2 would keep an older Core copy from reading the new shape. - The context's JSDoc names too narrow a layer: its comment says membership stops for a layer "opened from a member", but it stops for any layer opened inside the group.
Run locally, the targeted tests (49), the Lab typecheck, strict lint and the knowledge check pass, and the page that renders the card grows by 121 bytes gzip.
Claims and files checked
Review mode: full; reason: requested
Claims:
- Title: a card joins its group by value: verified (member path in the card; member tests run locally)
- Changeset: a card with a value takes selection, input and disabled default from its group: verified (member tests)
- Changeset: in a single choice the card is a radio that never deselects; in several choices it submits its value under the group's name: verified (radio and checkbox member tests, form data)
- Changeset: a new member props type; the standalone props stay an interface and gain only a never-typed value, so both together are rejected: verified (generated API delta; local typecheck)
- Changeset: a card with a value outside a group is unselected, reads as disabled and ignores clicks: verified (test; story probe)
- Changeset: a standalone card keeps its props type, DOM and behavior: verified (unchanged standalone tests pass; probe)
- Description: the Lab item repeated every card prop except selection and change: verified (base Lab source)
- Description: the card record kept single-select out of its public contract: verified (base record)
- Description: members take input type, name and disabled default from the group, send it requests, and a radio only selects: verified (code; tests)
- Description: the Lab item and its props type are removed, and the group provides one private context: verified (no references remain)
- Description: the chosen, enabled radio card renders the hidden submit input: verified (form-data test; DOM probe)
- Description: membership stops at a popover or dialog opened inside the group: verified (dialog test; popovers render the same layer boundary)
- Description: Lab reaches the context through Core's unchanged internal entry, and the follow-up removes the context exports and the aria-id joiner: verified (entry identical to base; follow-up's file at its head)
- Description: the record amendment needs an owner approval: verified (approved at this head)
- Description: a card is typed as standalone or member, never both, and two call signatures keep the derived props the standalone interface: verified (local typecheck)
- Description: Public delta block declares one union-typed signature: false (two overloads ship)
- Description: a standalone card keeps props, defaults, DOM and behavior; extending and omitting the derived props keep working: verified (typecheck of the test that pins both)
- Description: a stray card shows no hover or press paint and ignores clicks and keys: verified (disabled path; test)
- Description: a member's own disabled state adds to the group's, and a disabled member submits nothing: verified (tests)
- Description: in a group's DOM only the hidden submit input moves; no theming target, data attribute, token or string changes: verified (DOM probe; identical frames; API delta)
- Description: Core output names no Lab surface and has no development warning: verified (search of Core source, docs and changeset)
- Description: screenshots and pixel-identical states: reported (consistent with the identical frames captured locally)
- Description: listed unit cases: verified (each present; run locally)
- Description: mutation and red-first results: reported
- Description: browser spec results: reported (CI has not run)
- Description: one capability is added: verified
- Description: unrelated fixes and cleanup were removed or split: false (the docs file is re-wrapped)
- Description: docs, tests and migration ship; no internal context: verified
- Description: writing rubric results for the record: verified
- Description: preflight and test runs: reported; the targeted tests, Lab typecheck, strict lint and knowledge check re-run locally
- Description: first-load size moves from 18,010 to 18,131 bytes: verified (measured locally); the previous head's figure: reported
- Description: a new story shows a card with a value outside a group: verified
Files:
.changeset/selectable-card-group-value.md: clearapps/storybook/stories/SelectableCard.stories.tsx: clearapps/storybook/stories/SelectableCardGroup.stories.tsx: cleardocs/specs/components/SelectableCard/SelectableCard.spec.md: finding (stray-card warning sentence)packages/cli/test/swizzle-proof/samples.mjs: clearpackages/core/src/SelectableCard/SelectableCard.doc.mjs: finding (layout-only churn)packages/core/src/SelectableCard/SelectableCard.tsx: clearpackages/core/src/SelectableCard/SelectableCardRadio.test.tsx: clearpackages/core/src/SelectableCard/index.ts: clearpackages/core/src/SelectableCard/selectableCardInput.ts: two non-blocking notespackages/lab/blocks/SelectableCardGroupShippingSpeed.doc.mjs: clearpackages/lab/blocks/SelectableCardGroupShippingSpeed.tsx: clearpackages/lab/blocks/SelectableCardGroupShowcase.doc.mjs: clearpackages/lab/blocks/SelectableCardGroupShowcase.tsx: clearpackages/lab/src/SelectableCardGroup/SelectableCardGroup.doc.mjs: clearpackages/lab/src/SelectableCardGroup/SelectableCardGroup.test.tsx: clearpackages/lab/src/SelectableCardGroup/SelectableCardGroup.tsx: clearpackages/lab/src/SelectableCardGroup/index.ts: clearpackages/lab/src/index.ts: clear
| | Selection | selected; unselected | Controlled checked state, reflected as `data-selected`; a member's comes from its group. | Always | Required standalone; from the group for a member | `component:SelectableCard` | Stable | — | | ||
| | Disabled | enabled; disabled | Blocks toggling while keeping the input focusable, reflected as `data-disabled`; a group's `isDisabled` disables every member. | Always | enabled | `component:SelectableCard` | Stable | — | | ||
| | Variant | Card variants; theme additions | Card paint and the matching selection ring color. | Always | `default` | `component:Card` | Stable | A theme-added variant rings in `--selectable-card-ring-color` (default `--color-accent`) and keeps its border color. | | ||
| | Group value | a string | Identifies the card as a `SelectableCardGroup` member; the group's `value` names the selected members. | Inside `SelectableCardGroup` | none | `component:SelectableCard` | Stable | TypeScript rejects `isSelected` or `onChange` beside it (`spec:AST-002` FR15). Outside a group, a card with a `value` warns in development and renders unselected and inert. | |
There was a problem hiding this comment.
"warns in development": this head removed the warning, so a card with a value outside a group is only disabled (SelectableCard.tsx:533-542). Reword the sentence to what ships, for example "Outside a group, a card with a value renders unselected and disabled (FR5).", which also says what "inert" leaves open (the card stays focusable and is announced unavailable).
| {name: 'variant', type: "'default' | 'transparent' | 'muted' | 'blue' | 'cyan' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'yellow'", description: 'Background color variant.', default: "'default'"}, | ||
| {name: 'elevation', type: "'none' | 'low' | 'med' | 'high'", description: 'Resting shadow depth. The selection ring composes on top, so a selected card keeps its shadow.', default: "'none'"}, | ||
| { | ||
| name: 'padding', |
There was a problem hiding this comment.
From here to xstyle, and in usage, anatomy, theming, the playground and the dense descriptions, the entries only change layout: no hook or CI step formats .mjs. Restoring main's one-line layout for entries this change does not touch keeps the docs diff to the entries the member API changes.
| */ | ||
| export const SelectableCardInputContext = | ||
| createSharedContext<SelectableCardInput | null>( | ||
| createLayerScopedContext<SelectableCardInput | null>( |
There was a problem hiding this comment.
Non-blocking: the context value's fields changed (type, name, value became inputType, inputName, submitName, isDisabled, isSelected, onMemberChange), but the protocol version stays 1. sharedKey documents that "The version names the value's shape". Version 2 keeps an older Core copy on the page from reading the new shape.
| /** Without a provider, a card renders its own checkbox. */ | ||
| /** | ||
| * Without a provider, a card with a `value` has no group. Membership stops at | ||
| * a layer boundary, so a card in a layer opened from a member is not a member. |
There was a problem hiding this comment.
Non-blocking: membership stops for any layer opened inside the group, not only one opened from a member. Suggested: "Membership stops at a layer boundary. A card in a layer opened inside the group is not a member."
…yout - The Group value row says a card with a `value` outside a group renders unselected and disabled (FR5), as it now does; it no longer promises a development warning. - Restore SelectableCard.doc.mjs's layout for entries this change does not touch; only the six "card group" wordings differ from before. - Bump SelectableCardInputContext's protocol version to 2: its value changed shape, so an older copy on the page never reads it. - Say exactly where membership stops at a layer boundary. Co-authored-by: Ernest Tien <ernesttien@meta.com>
|
/approve-spec 9a66a04 |
SelectableCardGroup to Core, two pull requests. Review and merge in this order; each is based on the one before it, and both should ship in the same release (see "Release order").
valueis a member of the SelectableCardGroup around it ← this pull requestUser need
A product that asks people to choose among a few rich options, such as a plan, a shipping speed or a layout, shows them as cards. For one choice, keyboard and screen-reader users need a radio group: one tab stop, the arrow keys, and the position spoken. Today that takes Lab's SelectableCardGroup and its own card component, SelectableCardGroupItem, which repeats every SelectableCard prop except
isSelectedandonChange. Core's SelectableCard cannot be one choice of a set at all: its record keeps single-select out of its public contract until the group is in Core.So a builder learns two card components for one job, and the group cannot move to Core while its cards are a second API for that job (
architecture:public-component-apiINV21, one API per job).Problem and solution fit
valueon SelectableCard. A card with avalue, in place ofisSelectedandonChange, is a member of the SelectableCardGroup around it. The group gives it its selection, its input (a radio in a single choice, a checkbox in several), its input name and its disabled default, and the card sends the group its selection requests. A radio only selects.htmlName. The item wrapper used to render it beside the card.valuein a popover or a dialog opened inside the group is not a member (spec:AST-038FR7, FR8), as ToggleButtonGroup's context already behaves.component:SelectableCarddescribes the member case: DEC-1 (a card joins a group byvalue), a Group value concept, and FR1, FR2, FR5 and AR1 for a radio member.selectable-cardentry, which keeps itsSelectableCardInputContextexport from the sameselectableCardInput.tsmodule; the context now carries each member's input, selection and disabled default. feat(core): SelectableCardGroup moves to Core #13734 removes the context exports andjoinAriaIDsfrom that entry when the group moves to Core; the entry keepsuseFieldInputStyling.Current specification
component:SelectableCard(current): its ownership boundary kept single-select out of the public contract "until the group is promoted to Core". This pull request amends it, so it needs an engineering owner's/approve-spec.component:SelectableCardDEC-1, added here: a member identified byvaluetakes its selection from its group, as a ToggleButtonGroup member does (family:buttonsFR11). Rejected: a separate item component that wraps the card.spec:AST-002FR15 (invalid states are prevented where practical): a card is typed as standalone or as a member, never both.spec:AST-017FR25 (outside a declared minor, type changes are additive):SelectableCardPropskeeps its members and gains onlyvalue?: never; the member shape is a new type. SelectableCard has two call signatures, the member one first, soComponentProps<typeof SelectableCard>staysSelectableCardProps.spec:AST-038FR7, FR8 (group membership stops at a layer boundary).Public delta and caller burden
Core:
SelectableCardPropsstays an interface, andComponentProps<typeof SelectableCard>staysSelectableCardProps, sointerface X extends ComponentProps<typeof SelectableCard>andOmit<ComponentProps<typeof SelectableCard>, …>keep working; a test pins both.isSelectedoronChangebesidevalue, and a card with neither.valuerenders unselected and inert: it is disabled, so it reads as disabled, shows no hover or press paint, and ignores clicks and keys.isDisabledadds to the group's: a disabled group disables every card, and an enabled group does not enable a card that disables itself. A disabled member submits nothing.Lab (canary only): SelectableCardGroup's children are SelectableCards, and
SelectableCardGroupItemandSelectableCardGroupItemPropsare removed.The caller's one new decision: give a card a
value(a member) orisSelectedandonChange(standalone). In a group's DOM, one thing moves: the hidden input that submits a single choice sits inside the chosen card, after its radio, instead of after the card. No theming target, data attribute, token or string changes.Owner decision in this pull request: the name of the new public type,
SelectableCardMemberProps. The record names it, so approving the record approves the name.Design and alternatives
SelectableCardPropsas a union of a standalone shape and a member shape. It would make invalid combinations unrepresentable with no new type name, but it turns a released interface into a union:interface X extends SelectableCardPropsstops compiling (TS2312), and so does passing anOmit<SelectableCardProps, …>back to the card. That is a breaking type change, whichspec:AST-017FR25 keeps out of a patch release.isSelectedandonChange, ignored inside a group, as ToggleButton ignoresisPressed. It makes required props optional for code that reads them, and it lets a broken combination type-check (spec:AST-002FR15).Release order
Core's output names no Lab surface (
spec:AST-017FR27): its JSDoc,SelectableCard.doc.mjsand the Changeset say "card group", and the card has no development warning that names one. SelectableCardGroup itself stays Lab-only until #13734.Evidence
Real-browser screenshots of the Lab/SelectableCardGroup stories, from a static Storybook build of main and of this branch, served locally and captured in headless Chromium at 2× scale, scoped to
#storybook-root.All 14 captured states are pixel-identical before and after (0 differing pixels). The others: chose Team, multiple, vertical, two forms, one
htmlName, dark, Y2K, right to left, 320 px wide. In every state each input's type, value, checked state, form owner andaria-disabledalso match before and after.SelectableCardRadio.test.tsx): radio and checkbox members, Enter and click on a chosen radio, group and member disabled (each blocks selection and form submission), the chosen card's form value, a card without avaluein a group, a card with avalueoutside a group, a card in a layer inside a group, and the props types (@ts-expect-errorfor "both" and "neither", andextendsandOmitonSelectableCardProps).@ts-expect-errorcases fail with optional props in place of the two types.SelectableCardGroupRadio.a11y.chromium.spec.ts): one tab stop, arrows that move and select with wrapping, Space, a click on the chosen card, and two groups that share anhtmlNamein separate forms. The SelectableCard states ofCheckbox.a11y.chromium.spec.ts,CardPress,FocusRingOwnerandReducedMotionPresspass unchanged.Scope
Components: SelectableCard, SelectableCardGroup
Writing rubric results
docs/specs/components/SelectableCard/SelectableCard.spec.md:SelectableCardRadio.test.tsx, SelectableCardGroup's tests and its Chromium spec), not changes.Testing
Local gates on the first version of this branch, over main at aee3fa9:
pnpm preflight --browser: review:pre (0 findings), build, typecheck of the changed packages and their dependents, ESLint and Prettier on the changed files,check:repo, Vitest ui (842 files, 21,246 tests) and node (1,782 files, 27,833 tests, including all 8 swizzle-proof slices: 182 targets, 0 failures),check:knowledge,check:changesets, the Storybook build, and the 133 accessibility-contract specs the change selects all pass. The change selects the full Chromium interaction suite (2,008 tests, one worker); 1,847 passed before the local run hit its time limit, and the remaining files (NavigationStack, PageControl, RefreshControl, TabBar, Tour) then passed on their own: 206 passed, 1 skipped by its spec, none failed. The last commit after that run only adds the new type to the file header's@outputline; strict ESLint and Prettier pass on it.pnpm exec vitest run packages/core/src/SelectableCard packages/lab/src/SelectableCardGroup: 41 passed.pnpm storybook:build, thenplaywright test --project=chromium SelectableCardGroupRadio: 4 passed; the SelectableCard states ofCheckbox.a11y.chromium.spec.ts,CardPress,FocusRingOwnerandReducedMotionPress: 70 passed.ASTRYX_STRICT_LINT=1 eslinton the changed files: 0 errors.pnpm review:pre: 0 findings.pnpm check:knowledge: aligned, with 27 status warnings against main's 29.A second agent session that did not write the change reviewed it against the pre-review checklist; its findings are fixed here (the props types, the R7 rows, a disabled checkbox member's form test, and the comments).
Rebased onto main at d63c249. The diff is unchanged (identical patch id), and
pnpm preflightpasses again on this head: review:pre (0 findings), build, typecheck, lint, Vitest ui and node (including all 8 swizzle-proof slices, 0 failures),check:knowledgeandcheck:changesets, ending "ready to flip".Rebased onto main at a92c1ce. Conflicts came up in two files only, the SelectableCard record and
SelectableCard.doc.mjs; the other 18 files' changes are unchanged (same per-file patch ids). Main has since made the card's target reflectdata-disabled, added the forced-colors selection ring, reworded the record's project-status phrases, and renamed thelabeldescription. The resolved record keeps all of that and adds this pull request's member wording: the Contract-at-a-glance rows, the compatibility class, the Selection, Disabled and Group value concepts, FR1, FR2, FR4 and FR5, the radio-member state, and the group verification row. The source reads the effective disabled state fordata-disabled, so a member of a disabled group carries it too, and FR5 says so. Thelabeldescription now also names the radio a single-choice member renders. Prettier re-aligned the record's tables. On this headpnpm preflightpasses: review:pre (0 findings), build, typecheck, lint, Vitest ui (21,829 tests) and node (28,234 tests, including all 8 swizzle-proof slices, 0 failures),check:knowledge(aligned, no warnings, as on main) andcheck:changesets, ending "ready to flip". The screenshots above predate this rebase.Main merge (c903d9b, a maintainer carry; the commit above is unchanged): in
docs/specs/components/SelectableCard/SelectableCard.spec.md, the verification map keeps main's rows, including its updated "FR2 (nested)" row, and adds this branch's "Group membership" row. No other change.Maintainer carry at d4f41c2 (Co-authored-by: @ernestt)
(Posted by Cindy's agent.) Six review fixes in one push; @ernestt's design and record approval are unchanged.
ComponentProps<typeof SelectableCard>was a union, sointerface X extends ComponentProps<typeof SelectableCard>and anOmitspread stopped compiling in a patch (spec:AST-017FR25). The last signature is the standalone interface again.valueoutside a group is disabledonClick, showed hover and press paint, and read as an enabled checkbox.spec:AST-017FR27).selectableCardInput.tsasSelectableCardInputContextarchitecture:knowledge-contractsDEC-22); Core'sinternal/selectable-cardentry is unchanged from main.createLayerScopedContextRed first, at c903d9b with the new tests: "a card with a value outside a group stays unselected and inert" fails (its
onClickruns, noaria-disabled), and Core's typecheck fails the extended-props test with TS2312. Both pass at d4f41c2.First-load size (the size report's
measureEntry, a page that importsSelectableCard): main b3411f8 18,010 B; c903d9b 18,339 B (+329 B); d4f41c2 18,131 B (+121 B, under the 307 B thatarchitecture:component-import-boundariesINV10 allows an opt-in feature).Checks at d4f41c2: SelectableCard and Lab SelectableCardGroup tests 49/49; Core, Lab and Storybook typechecks clean; strict eslint 0 errors; Prettier clean; swizzle-proof samples 24 passed;
pnpm check:knowledgealigned.Story:
Core/SelectableCardgainsValueOutsideAGroup, a standalone card beside a card with avalueand no group.